-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(propagation): only call extract once per request for flask and django #11871
base: main
Are you sure you want to change the base?
Conversation
|
# this returns ddtrace.settings.integration.IntegrationConfig, we should change the naming to reflect this | ||
# from distributed_headers_config to integration_config. Need to do this for calls of method too | ||
integration_config = ctx.get_item("distributed_headers_config") | ||
activate_distributed_headers = ctx.get_item("activate_distributed_headers") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BenchmarksBenchmark execution time: 2025-01-10 21:58:34 Comparing candidate commit 46d5d0c in PR branch Found 14 performance improvements and 0 performance regressions! Performance is the same for 334 metrics, 2 unstable metrics. scenario:flasksimple-appsec-get
scenario:flasksimple-appsec-post
scenario:flasksimple-appsec-telemetry
scenario:flasksimple-tracer
scenario:flasksqli-appsec-enabled
scenario:flasksqli-iast-enabled
scenario:flasksqli-tracer-enabled
|
Currently core will call start_span for each flask span and django span generated. Each start_span call calls activate_distribute_headers, which in turn call HTTP_PROPAGATOR.extract. This leads to around 4-8 unneeded calls of that method per request. The logic in activate_distributed_headers is what's currently saving us from not re-activating the same context over and over again when each new span is generated.
Checklist
Reviewer Checklist